package persistencia.homes;

import java.util.LinkedList;
import java.util.List;

import artistas.ArtistaMusical;
import espectaculos.Gira;

/**
 * TODO: description
 */
public class ArtistaMusicalHome extends GenericHome {

    public static List<ArtistaMusical> listAll() {
        List<ArtistaMusical> result = new LinkedList<ArtistaMusical>();
        result.addAll(SolistaHome.listAll());
        result.addAll(BandaHome.listAll());
        return result;
    }

    public static ArtistaMusical get(final ArtistaMusical art) {
        return (ArtistaMusical) GenericHome.get(art);
    }

    public static int recaudacionTotalArtista(final ArtistaMusical art) {
        List<Gira> giras = GiraHome.girasArtista(art);
        int recaudacion = 0;
        for (Gira gira : giras) {
            recaudacion = recaudacion + gira.recaudacionTotal();
        }
        return recaudacion;
    }
}
